{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "f2dc90e9",
   "metadata": {},
   "source": [
    "### 一、安装chroma"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "ed73f9b4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple\n",
      "Collecting chromadb\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/90/64/595af82790623f72ee8301fcbfca55192e8e1f2d65562a14bc549e596b06/chromadb-1.1.0-cp39-abi3-win_amd64.whl (19.8 MB)\n",
      "     ---------------------------------------- 0.0/19.8 MB ? eta -:--:--\n",
      "     - -------------------------------------- 0.5/19.8 MB 5.6 MB/s eta 0:00:04\n",
      "     -- ------------------------------------- 1.3/19.8 MB 4.2 MB/s eta 0:00:05\n",
      "     ---- ----------------------------------- 2.4/19.8 MB 3.9 MB/s eta 0:00:05\n",
      "     ------ --------------------------------- 3.1/19.8 MB 3.9 MB/s eta 0:00:05\n",
      "     ------- -------------------------------- 3.9/19.8 MB 4.0 MB/s eta 0:00:04\n",
      "     ----------- ---------------------------- 5.5/19.8 MB 4.5 MB/s eta 0:00:04\n",
      "     --------------- ------------------------ 7.9/19.8 MB 5.5 MB/s eta 0:00:03\n",
      "     ------------------------ --------------- 12.3/19.8 MB 7.5 MB/s eta 0:00:01\n",
      "     --------------------------------------  19.7/19.8 MB 10.7 MB/s eta 0:00:01\n",
      "     --------------------------------------  19.7/19.8 MB 10.7 MB/s eta 0:00:01\n",
      "     ---------------------------------------- 19.8/19.8 MB 9.5 MB/s  0:00:02\n",
      "Collecting build>=1.0.3 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/cb/8c/2b30c12155ad8de0cf641d76a8b396a16d2c36bc6d50b621a62b7c4567c1/build-1.3.0-py3-none-any.whl (23 kB)\n",
      "Collecting pydantic>=1.9 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3e/d3/108f2006987c58e76691d5ae5d200dd3e0f532cb4e5fa3560751c3a1feba/pydantic-2.11.9-py3-none-any.whl (444 kB)\n",
      "Collecting pybase64>=1.4.1 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/4f/bc/d5c277496063a09707486180f17abbdbdebbf2f5c4441b20b11d3cb7dc7c/pybase64-1.4.2-cp312-cp312-win_amd64.whl (35 kB)\n",
      "Collecting uvicorn>=0.18.3 (from uvicorn[standard]>=0.18.3->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d2/e2/dc81b1bd1dcfe91735810265e9d26bc8ec5da45b4c0f6237e286819194c3/uvicorn-0.35.0-py3-none-any.whl (66 kB)\n",
      "Collecting numpy>=1.22.5 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/32/ee/de999f2625b80d043d6d2d628c07d0d5555a677a3cf78fdf868d409b8766/numpy-2.3.3-cp312-cp312-win_amd64.whl (12.8 MB)\n",
      "Collecting posthog<6.0.0,>=2.4.0 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/4f/98/e480cab9a08d1c09b1c59a93dade92c1bb7544826684ff2acbfd10fcfbd4/posthog-5.4.0-py3-none-any.whl (105 kB)\n",
      "Requirement already satisfied: typing-extensions>=4.5.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from chromadb) (4.15.0)\n",
      "Collecting onnxruntime>=1.14.1 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/5d/54/7139d463bb0a312890c9a5db87d7815d4a8cce9e6f5f28d04f0b55fcb160/onnxruntime-1.22.1-cp312-cp312-win_amd64.whl (12.7 MB)\n",
      "     ---------------------------------------- 0.0/12.7 MB ? eta -:--:--\n",
      "     ---------------------------- ----------- 9.2/12.7 MB 43.7 MB/s eta 0:00:01\n",
      "     --------------------------------------  12.6/12.7 MB 46.3 MB/s eta 0:00:01\n",
      "     ---------------------------------------- 12.7/12.7 MB 28.4 MB/s  0:00:00\n",
      "Collecting opentelemetry-api>=1.2.0 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/91/48/28ed9e55dcf2f453128df738210a980e09f4e468a456fa3c763dbc8be70a/opentelemetry_api-1.37.0-py3-none-any.whl (65 kB)\n",
      "Collecting opentelemetry-exporter-otlp-proto-grpc>=1.2.0 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/39/17/46630b74751031a658706bef23ac99cdc2953cd3b2d28ec90590a0766b3e/opentelemetry_exporter_otlp_proto_grpc-1.37.0-py3-none-any.whl (19 kB)\n",
      "Collecting opentelemetry-sdk>=1.2.0 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/9f/62/9f4ad6a54126fb00f7ed4bb5034964c6e4f00fcd5a905e115bd22707e20d/opentelemetry_sdk-1.37.0-py3-none-any.whl (131 kB)\n",
      "Collecting tokenizers>=0.13.2 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d1/9b/0e0bf82214ee20231845b127aa4a8015936ad5a46779f30865d10e404167/tokenizers-0.22.0-cp39-abi3-win_amd64.whl (2.7 MB)\n",
      "     ---------------------------------------- 0.0/2.7 MB ? eta -:--:--\n",
      "     ---------------------------------------- 2.7/2.7 MB 26.0 MB/s  0:00:00\n",
      "Collecting pypika>=0.48.9 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c7/2c/94ed7b91db81d61d7096ac8f2d325ec562fc75e35f3baea8749c85b28784/PyPika-0.48.9.tar.gz (67 kB)\n",
      "  Installing build dependencies: started\n",
      "  Installing build dependencies: finished with status 'done'\n",
      "  Getting requirements to build wheel: started\n",
      "  Getting requirements to build wheel: finished with status 'done'\n",
      "  Preparing metadata (pyproject.toml): started\n",
      "  Preparing metadata (pyproject.toml): finished with status 'done'\n",
      "Collecting tqdm>=4.65.0 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl (78 kB)\n",
      "Collecting overrides>=7.3.1 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2c/ab/fc8290c6a4c722e5514d80f62b2dc4c4df1a68a41d1364e625c35990fcf3/overrides-7.7.0-py3-none-any.whl (17 kB)\n",
      "Collecting importlib-resources (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a4/ed/1f1afb2e9e7f38a545d628f864d562a5ae64fe6f7a10e28ffb9b185b4e89/importlib_resources-6.5.2-py3-none-any.whl (37 kB)\n",
      "Collecting grpcio>=1.58.0 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ff/14/e1309a570b7ebdd1c8ca24c4df6b8d6690009fa8e0d997cb2c026ce850c9/grpcio-1.75.0-cp312-cp312-win_amd64.whl (4.6 MB)\n",
      "     ---------------------------------------- 0.0/4.6 MB ? eta -:--:--\n",
      "     ---------------------------------------- 4.6/4.6 MB 27.9 MB/s  0:00:00\n",
      "Collecting bcrypt>=4.0.1 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a9/cf/45fb5261ece3e6b9817d3d82b2f343a505fd58674a92577923bc500bd1aa/bcrypt-4.3.0-cp39-abi3-win_amd64.whl (152 kB)\n",
      "Collecting typer>=0.9.0 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/93/72/6b3e70d32e89a5cbb6a4513726c1ae8762165b027af569289e19ec08edd8/typer-0.17.4-py3-none-any.whl (46 kB)\n",
      "Collecting kubernetes>=28.1.0 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/89/43/d9bebfc3db7dea6ec80df5cb2aad8d274dd18ec2edd6c4f21f32c237cbbb/kubernetes-33.1.0-py2.py3-none-any.whl (1.9 MB)\n",
      "     ---------------------------------------- 0.0/1.9 MB ? eta -:--:--\n",
      "     ---------------------------------------- 1.9/1.9 MB 26.7 MB/s  0:00:00\n",
      "Collecting tenacity>=8.2.3 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e5/30/643397144bfbfec6f6ef821f36f33e57d35946c44a2352d3c9f0ae847619/tenacity-9.1.2-py3-none-any.whl (28 kB)\n",
      "Requirement already satisfied: pyyaml>=6.0.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from chromadb) (6.0.2)\n",
      "Collecting mmh3>=4.0.1 (from chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b8/f6/f6abdcfefcedab3c964868048cfe472764ed358c2bf6819a70dd4ed4ed3a/mmh3-5.2.0-cp312-cp312-win_amd64.whl (41 kB)\n",
      "Collecting orjson>=3.9.12 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/35/b8/9e3127d65de7fff243f7f3e53f59a531bf6bb295ebe5db024c2503cc0726/orjson-3.11.3-cp312-cp312-win_amd64.whl (131 kB)\n",
      "Requirement already satisfied: httpx>=0.27.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from chromadb) (0.28.1)\n",
      "Collecting rich>=10.11.0 (from chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e3/30/3c4d035596d3cf444529e0b2953ad0466f6049528a879d27534700580395/rich-14.1.0-py3-none-any.whl (243 kB)\n",
      "Requirement already satisfied: jsonschema>=4.19.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from chromadb) (4.25.1)\n",
      "Requirement already satisfied: requests<3.0,>=2.7 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from posthog<6.0.0,>=2.4.0->chromadb) (2.32.5)\n",
      "Requirement already satisfied: six>=1.5 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from posthog<6.0.0,>=2.4.0->chromadb) (1.17.0)\n",
      "Requirement already satisfied: python-dateutil>=2.2 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from posthog<6.0.0,>=2.4.0->chromadb) (2.9.0.post0)\n",
      "Collecting backoff>=1.10.0 (from posthog<6.0.0,>=2.4.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/df/73/b6e24bd22e6720ca8ee9a85a0c4a2971af8497d8f3193fa05390cbd46e09/backoff-2.2.1-py3-none-any.whl (15 kB)\n",
      "Collecting distro>=1.5.0 (from posthog<6.0.0,>=2.4.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl (20 kB)\n",
      "Requirement already satisfied: charset_normalizer<4,>=2 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from requests<3.0,>=2.7->posthog<6.0.0,>=2.4.0->chromadb) (3.4.3)\n",
      "Requirement already satisfied: idna<4,>=2.5 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from requests<3.0,>=2.7->posthog<6.0.0,>=2.4.0->chromadb) (3.10)\n",
      "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from requests<3.0,>=2.7->posthog<6.0.0,>=2.4.0->chromadb) (2.5.0)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from requests<3.0,>=2.7->posthog<6.0.0,>=2.4.0->chromadb) (2025.8.3)\n",
      "Requirement already satisfied: packaging>=19.1 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from build>=1.0.3->chromadb) (25.0)\n",
      "Collecting pyproject_hooks (from build>=1.0.3->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl (10 kB)\n",
      "Requirement already satisfied: colorama in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from build>=1.0.3->chromadb) (0.4.6)\n",
      "Requirement already satisfied: anyio in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from httpx>=0.27.0->chromadb) (4.10.0)\n",
      "Requirement already satisfied: httpcore==1.* in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from httpx>=0.27.0->chromadb) (1.0.9)\n",
      "Requirement already satisfied: h11>=0.16 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from httpcore==1.*->httpx>=0.27.0->chromadb) (0.16.0)\n",
      "Requirement already satisfied: attrs>=22.2.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from jsonschema>=4.19.0->chromadb) (25.3.0)\n",
      "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from jsonschema>=4.19.0->chromadb) (2025.9.1)\n",
      "Requirement already satisfied: referencing>=0.28.4 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.36.2)\n",
      "Requirement already satisfied: rpds-py>=0.7.1 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from jsonschema>=4.19.0->chromadb) (0.27.1)\n",
      "Collecting google-auth>=1.0.1 (from kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/17/63/b19553b658a1692443c62bd07e5868adaa0ad746a0751ba62c59568cd45b/google_auth-2.40.3-py2.py3-none-any.whl (216 kB)\n",
      "Requirement already satisfied: websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from kubernetes>=28.1.0->chromadb) (1.8.0)\n",
      "Collecting requests-oauthlib (from kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3b/5d/63d4ae3b9daea098d5d6f5da83984853c1bbacd5dc826764b249fe119d24/requests_oauthlib-2.0.0-py2.py3-none-any.whl (24 kB)\n",
      "Collecting oauthlib>=3.2.2 (from kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/be/9c/92789c596b8df838baa98fa71844d84283302f7604ed565dafe5a6b5041a/oauthlib-3.3.1-py3-none-any.whl (160 kB)\n",
      "Collecting durationpy>=0.7 (from kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b0/0d/9feae160378a3553fa9a339b0e9c1a048e147a4127210e286ef18b730f03/durationpy-0.10-py3-none-any.whl (3.9 kB)\n",
      "Collecting cachetools<6.0,>=2.0.0 (from google-auth>=1.0.1->kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/72/76/20fa66124dbe6be5cafeb312ece67de6b61dd91a0247d1ea13db4ebb33c2/cachetools-5.5.2-py3-none-any.whl (10 kB)\n",
      "Collecting pyasn1-modules>=0.2.1 (from google-auth>=1.0.1->kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/47/8d/d529b5d697919ba8c11ad626e835d4039be708a35b0d22de83a269a6682c/pyasn1_modules-0.4.2-py3-none-any.whl (181 kB)\n",
      "Collecting rsa<5,>=3.1.4 (from google-auth>=1.0.1->kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/64/8d/0133e4eb4beed9e425d9a98ed6e081a55d195481b7632472be1af08d2f6b/rsa-4.9.1-py3-none-any.whl (34 kB)\n",
      "Collecting pyasn1>=0.1.3 (from rsa<5,>=3.1.4->google-auth>=1.0.1->kubernetes>=28.1.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c8/f1/d6a797abb14f6283c0ddff96bbdd46937f64122b8c925cab503dd37f8214/pyasn1-0.6.1-py3-none-any.whl (83 kB)\n",
      "Collecting coloredlogs (from onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a7/06/3d6badcf13db419e25b07041d9c7b4a2c331d3f4e7134445ec5df57714cd/coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)\n",
      "Collecting flatbuffers (from onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b8/25/155f9f080d5e4bc0082edfda032ea2bc2b8fab3f4d25d46c1e9dd22a1a89/flatbuffers-25.2.10-py2.py3-none-any.whl (30 kB)\n",
      "Collecting protobuf (from onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/8c/f3/6f58f841f6ebafe076cebeae33fc336e900619d34b1c93e4b5c97a81fdfa/protobuf-6.32.1-cp310-abi3-win_amd64.whl (435 kB)\n",
      "Collecting sympy (from onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl (6.3 MB)\n",
      "     ---------------------------------------- 0.0/6.3 MB ? eta -:--:--\n",
      "     ---------------------------------------- 6.3/6.3 MB 29.7 MB/s  0:00:00\n",
      "Collecting importlib-metadata<8.8.0,>=6.0 (from opentelemetry-api>=1.2.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl (27 kB)\n",
      "Collecting zipp>=3.20 (from importlib-metadata<8.8.0,>=6.0->opentelemetry-api>=1.2.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl (10 kB)\n",
      "Collecting googleapis-common-protos~=1.57 (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/86/f1/62a193f0227cf15a920390abe675f386dec35f7ae3ffe6da582d3ade42c7/googleapis_common_protos-1.70.0-py3-none-any.whl (294 kB)\n",
      "Collecting opentelemetry-exporter-otlp-proto-common==1.37.0 (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/08/13/b4ef09837409a777f3c0af2a5b4ba9b7af34872bc43609dda0c209e4060d/opentelemetry_exporter_otlp_proto_common-1.37.0-py3-none-any.whl (18 kB)\n",
      "Collecting opentelemetry-proto==1.37.0 (from opentelemetry-exporter-otlp-proto-grpc>=1.2.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c4/25/f89ea66c59bd7687e218361826c969443c4fa15dfe89733f3bf1e2a9e971/opentelemetry_proto-1.37.0-py3-none-any.whl (72 kB)\n",
      "Collecting opentelemetry-semantic-conventions==0.58b0 (from opentelemetry-sdk>=1.2.0->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/07/90/68152b7465f50285d3ce2481b3aec2f82822e3f52e5152eeeaf516bab841/opentelemetry_semantic_conventions-0.58b0-py3-none-any.whl (207 kB)\n",
      "Collecting annotated-types>=0.6.0 (from pydantic>=1.9->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl (13 kB)\n",
      "Collecting pydantic-core==2.33.2 (from pydantic>=1.9->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/43/e4/5479fecb3606c1368d496a825d8411e126133c41224c1e7238be58b87d7e/pydantic_core-2.33.2-cp312-cp312-win_amd64.whl (2.0 MB)\n",
      "Collecting typing-inspection>=0.4.0 (from pydantic>=1.9->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl (14 kB)\n",
      "Collecting markdown-it-py>=2.2.0 (from rich>=10.11.0->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl (87 kB)\n",
      "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from rich>=10.11.0->chromadb) (2.19.2)\n",
      "Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich>=10.11.0->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl (10.0 kB)\n",
      "Collecting huggingface-hub<1.0,>=0.16.4 (from tokenizers>=0.13.2->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/fe/85/a18508becfa01f1e4351b5e18651b06d210dbd96debccd48a452acccb901/huggingface_hub-0.35.0-py3-none-any.whl (563 kB)\n",
      "Collecting filelock (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/42/14/42b2651a2f46b022ccd948bca9f2d5af0fd8929c4eec235b8d6d844fbe67/filelock-3.19.1-py3-none-any.whl (15 kB)\n",
      "Collecting fsspec>=2023.5.0 (from huggingface-hub<1.0,>=0.16.4->tokenizers>=0.13.2->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/47/71/70db47e4f6ce3e5c37a607355f80da8860a33226be640226ac52cb05ef2e/fsspec-2025.9.0-py3-none-any.whl (199 kB)\n",
      "Collecting click>=8.0.0 (from typer>=0.9.0->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/db/d3/9dcc0f5797f070ec8edf30fbadfb200e71d9db6b84d211e3b2085a7589a0/click-8.3.0-py3-none-any.whl (107 kB)\n",
      "Collecting shellingham>=1.3.0 (from typer>=0.9.0->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)\n",
      "Collecting httptools>=0.6.3 (from uvicorn[standard]>=0.18.3->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/12/b7/5cae71a8868e555f3f67a50ee7f673ce36eac970f029c0c5e9d584352961/httptools-0.6.4-cp312-cp312-win_amd64.whl (88 kB)\n",
      "Collecting python-dotenv>=0.13 (from uvicorn[standard]>=0.18.3->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/5f/ed/539768cf28c661b5b068d66d96a2f155c4971a5d55684a514c1a0e0dec2f/python_dotenv-1.1.1-py3-none-any.whl (20 kB)\n",
      "Collecting watchfiles>=0.13 (from uvicorn[standard]>=0.18.3->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/3f/d3/3ae9d5124ec75143bdf088d436cba39812122edc47709cd2caafeac3266f/watchfiles-1.1.0-cp312-cp312-win_amd64.whl (292 kB)\n",
      "Collecting websockets>=10.4 (from uvicorn[standard]>=0.18.3->chromadb)\n",
      "  Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/7d/71/abf2ebc3bbfa40f391ce1428c7168fb20582d0ff57019b69ea20fa698043/websockets-15.0.1-cp312-cp312-win_amd64.whl (176 kB)\n",
      "Requirement already satisfied: sniffio>=1.1 in c:\\programdata\\miniconda3\\envs\\study_chroma\\lib\\site-packages (from anyio->httpx>=0.27.0->chromadb) (1.3.1)\n",
      "Collecting humanfriendly>=9.1 (from coloredlogs->onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f0/0f/310fb31e39e2d734ccaa2c0fb981ee41f7bd5056ce9bc29b2248bd569169/humanfriendly-10.0-py2.py3-none-any.whl (86 kB)\n",
      "Collecting pyreadline3 (from humanfriendly>=9.1->coloredlogs->onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/5a/dc/491b7661614ab97483abf2056be1deee4dc2490ecbf7bff9ab5cdbac86e1/pyreadline3-3.5.4-py3-none-any.whl (83 kB)\n",
      "Collecting mpmath<1.4,>=1.1.0 (from sympy->onnxruntime>=1.14.1->chromadb)\n",
      "  Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl (536 kB)\n",
      "     ---------------------------------------- 0.0/536.2 kB ? eta -:--:--\n",
      "     ---------------------------------------- 536.2/536.2 kB 8.6 MB/s  0:00:00\n",
      "Building wheels for collected packages: pypika\n",
      "  Building wheel for pypika (pyproject.toml): started\n",
      "  Building wheel for pypika (pyproject.toml): finished with status 'done'\n",
      "  Created wheel for pypika: filename=pypika-0.48.9-py2.py3-none-any.whl size=53916 sha256=ef800c6ea8b7c4d4f8ed62ec4d77a35ec5a262d593b811d0df9fd644c436d4e3\n",
      "  Stored in directory: c:\\users\\administrator\\appdata\\local\\pip\\cache\\wheels\\60\\c4\\38\\a856969b3625eefefe6aba6268a814ae17367b2d228f73e7d5\n",
      "Successfully built pypika\n",
      "Installing collected packages: pypika, mpmath, flatbuffers, durationpy, zipp, websockets, typing-inspection, tqdm, tenacity, sympy, shellingham, python-dotenv, pyreadline3, pyproject_hooks, pydantic-core, pybase64, pyasn1, protobuf, overrides, orjson, oauthlib, numpy, mmh3, mdurl, importlib-resources, httptools, grpcio, fsspec, filelock, distro, click, cachetools, bcrypt, backoff, annotated-types, watchfiles, uvicorn, rsa, requests-oauthlib, pydantic, pyasn1-modules, posthog, opentelemetry-proto, markdown-it-py, importlib-metadata, humanfriendly, huggingface-hub, googleapis-common-protos, build, tokenizers, rich, opentelemetry-exporter-otlp-proto-common, opentelemetry-api, google-auth, coloredlogs, typer, opentelemetry-semantic-conventions, onnxruntime, kubernetes, opentelemetry-sdk, opentelemetry-exporter-otlp-proto-grpc, chromadb\n",
      "\n",
      "    ---------------------------------------  1/62 [mpmath]\n",
      "    ---------------------------------------  1/62 [mpmath]\n",
      "    ---------------------------------------  1/62 [mpmath]\n",
      "    ---------------------------------------  1/62 [mpmath]\n",
      "    ---------------------------------------  1/62 [mpmath]\n",
      "   - --------------------------------------  2/62 [flatbuffers]\n",
      "   --- ------------------------------------  5/62 [websockets]\n",
      "   --- ------------------------------------  5/62 [websockets]\n",
      "   --- ------------------------------------  6/62 [typing-inspection]\n",
      "   ---- -----------------------------------  7/62 [tqdm]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ----- ----------------------------------  9/62 [sympy]\n",
      "   ------ --------------------------------- 10/62 [shellingham]\n",
      "   ------- -------------------------------- 12/62 [pyreadline3]\n",
      "   ------- -------------------------------- 12/62 [pyreadline3]\n",
      "   --------- ------------------------------ 15/62 [pybase64]\n",
      "   ---------- ----------------------------- 16/62 [pyasn1]\n",
      "   ---------- ----------------------------- 16/62 [pyasn1]\n",
      "   ---------- ----------------------------- 17/62 [protobuf]\n",
      "   ---------- ----------------------------- 17/62 [protobuf]\n",
      "   ----------- ---------------------------- 18/62 [overrides]\n",
      "   ------------ --------------------------- 20/62 [oauthlib]\n",
      "   ------------ --------------------------- 20/62 [oauthlib]\n",
      "   ------------ --------------------------- 20/62 [oauthlib]\n",
      "   ------------ --------------------------- 20/62 [oauthlib]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   ------------- -------------------------- 21/62 [numpy]\n",
      "   -------------- ------------------------- 23/62 [mdurl]\n",
      "   --------------- ------------------------ 24/62 [importlib-resources]\n",
      "   ---------------- ----------------------- 26/62 [grpcio]\n",
      "   ---------------- ----------------------- 26/62 [grpcio]\n",
      "   ---------------- ----------------------- 26/62 [grpcio]\n",
      "   ----------------- ---------------------- 27/62 [fsspec]\n",
      "   ----------------- ---------------------- 27/62 [fsspec]\n",
      "   ----------------- ---------------------- 27/62 [fsspec]\n",
      "   ------------------- -------------------- 30/62 [click]\n",
      "   --------------------- ------------------ 33/62 [backoff]\n",
      "   ----------------------- ---------------- 36/62 [uvicorn]\n",
      "   ----------------------- ---------------- 36/62 [uvicorn]\n",
      "   ----------------------- ---------------- 37/62 [rsa]\n",
      "   ------------------------ --------------- 38/62 [requests-oauthlib]\n",
      "   ------------------------- -------------- 39/62 [pydantic]\n",
      "   ------------------------- -------------- 39/62 [pydantic]\n",
      "   ------------------------- -------------- 39/62 [pydantic]\n",
      "   ------------------------- -------------- 39/62 [pydantic]\n",
      "   ------------------------- -------------- 39/62 [pydantic]\n",
      "   ------------------------- -------------- 39/62 [pydantic]\n",
      "   ------------------------- -------------- 40/62 [pyasn1-modules]\n",
      "   ------------------------- -------------- 40/62 [pyasn1-modules]\n",
      "   ------------------------- -------------- 40/62 [pyasn1-modules]\n",
      "   ------------------------- -------------- 40/62 [pyasn1-modules]\n",
      "   ------------------------- -------------- 40/62 [pyasn1-modules]\n",
      "   ------------------------- -------------- 40/62 [pyasn1-modules]\n",
      "   -------------------------- ------------- 41/62 [posthog]\n",
      "   -------------------------- ------------- 41/62 [posthog]\n",
      "   --------------------------- ------------ 42/62 [opentelemetry-proto]\n",
      "   --------------------------- ------------ 42/62 [opentelemetry-proto]\n",
      "   --------------------------- ------------ 43/62 [markdown-it-py]\n",
      "   --------------------------- ------------ 43/62 [markdown-it-py]\n",
      "   ---------------------------- ----------- 44/62 [importlib-metadata]\n",
      "   ----------------------------- ---------- 45/62 [humanfriendly]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ----------------------------- ---------- 46/62 [huggingface-hub]\n",
      "   ------------------------------ --------- 47/62 [googleapis-common-protos]\n",
      "   ------------------------------ --------- 47/62 [googleapis-common-protos]\n",
      "   ------------------------------ --------- 47/62 [googleapis-common-protos]\n",
      "   ------------------------------ --------- 48/62 [build]\n",
      "   -------------------------------- ------- 50/62 [rich]\n",
      "   -------------------------------- ------- 50/62 [rich]\n",
      "   -------------------------------- ------- 50/62 [rich]\n",
      "   -------------------------------- ------- 50/62 [rich]\n",
      "   --------------------------------- ------ 52/62 [opentelemetry-api]\n",
      "   ---------------------------------- ----- 53/62 [google-auth]\n",
      "   ---------------------------------- ----- 53/62 [google-auth]\n",
      "   ---------------------------------- ----- 53/62 [google-auth]\n",
      "   ----------------------------------- ---- 55/62 [typer]\n",
      "   ----------------------------- --- 56/62 [opentelemetry-semantic-conventions]\n",
      "   ----------------------------- --- 56/62 [opentelemetry-semantic-conventions]\n",
      "   ----------------------------- --- 56/62 [opentelemetry-semantic-conventions]\n",
      "   ----------------------------- --- 56/62 [opentelemetry-semantic-conventions]\n",
      "   ----------------------------- --- 56/62 [opentelemetry-semantic-conventions]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------ --- 57/62 [onnxruntime]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   ------------------------------------- -- 58/62 [kubernetes]\n",
      "   -------------------------------------- - 59/62 [opentelemetry-sdk]\n",
      "   -------------------------------------- - 59/62 [opentelemetry-sdk]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------  61/62 [chromadb]\n",
      "   ---------------------------------------- 62/62 [chromadb]\n",
      "\n",
      "Successfully installed annotated-types-0.7.0 backoff-2.2.1 bcrypt-4.3.0 build-1.3.0 cachetools-5.5.2 chromadb-1.1.0 click-8.3.0 coloredlogs-15.0.1 distro-1.9.0 durationpy-0.10 filelock-3.19.1 flatbuffers-25.2.10 fsspec-2025.9.0 google-auth-2.40.3 googleapis-common-protos-1.70.0 grpcio-1.75.0 httptools-0.6.4 huggingface-hub-0.35.0 humanfriendly-10.0 importlib-metadata-8.7.0 importlib-resources-6.5.2 kubernetes-33.1.0 markdown-it-py-4.0.0 mdurl-0.1.2 mmh3-5.2.0 mpmath-1.3.0 numpy-2.3.3 oauthlib-3.3.1 onnxruntime-1.22.1 opentelemetry-api-1.37.0 opentelemetry-exporter-otlp-proto-common-1.37.0 opentelemetry-exporter-otlp-proto-grpc-1.37.0 opentelemetry-proto-1.37.0 opentelemetry-sdk-1.37.0 opentelemetry-semantic-conventions-0.58b0 orjson-3.11.3 overrides-7.7.0 posthog-5.4.0 protobuf-6.32.1 pyasn1-0.6.1 pyasn1-modules-0.4.2 pybase64-1.4.2 pydantic-2.11.9 pydantic-core-2.33.2 pypika-0.48.9 pyproject_hooks-1.2.0 pyreadline3-3.5.4 python-dotenv-1.1.1 requests-oauthlib-2.0.0 rich-14.1.0 rsa-4.9.1 shellingham-1.5.4 sympy-1.14.0 tenacity-9.1.2 tokenizers-0.22.0 tqdm-4.67.1 typer-0.17.4 typing-inspection-0.4.1 uvicorn-0.35.0 watchfiles-1.1.0 websockets-15.0.1 zipp-3.23.0\n"
     ]
    }
   ],
   "source": [
    "!pip install chromadb"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "35109945",
   "metadata": {},
   "source": [
    "### 二、创建Client"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "73b890be",
   "metadata": {},
   "outputs": [],
   "source": [
    "import chromadb\n",
    "\n",
    "chroma_client = chromadb.EphemeralClient()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "38fa904a",
   "metadata": {},
   "source": [
    "### 三、创建collection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "ccd7f0c5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 指定向量模型\n",
    "from chromadb.utils.embedding_functions import OpenAIEmbeddingFunction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "066ae1de",
   "metadata": {},
   "outputs": [],
   "source": [
    "collection = chroma_client.create_collection(\n",
    "    name=\"cosine_collection\",\n",
    "    embedding_function=OpenAIEmbeddingFunction(\n",
    "        api_base=\"https://dashscope.aliyuncs.com/compatible-mode/v1\",\n",
    "        api_key=\"sk-da90821cf9174fbeb854011015c67aad\",\n",
    "        model_name=\"text-embedding-v3\"\n",
    "    ),\n",
    "    configuration={\n",
    "        \"hnsw\": {\n",
    "            \"space\": \"cosine\",\n",
    "            \"ef_construction\": 200\n",
    "        }\n",
    "    }\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1c4ddbb3",
   "metadata": {},
   "source": [
    "### 四、CRUD"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "43d7d604",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 新增\n",
    "collection.add(\n",
    "    ids=[\"id1\", \"id2\"],\n",
    "    documents=[\n",
    "        \"This is a document about pineapple\",\n",
    "        \"This is a document about oranges\"\n",
    "    ]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "479af258",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'ids': [['id1', 'id2']],\n",
       " 'embeddings': None,\n",
       " 'documents': [['This is a document about pineapple',\n",
       "   'This is a document about oranges']],\n",
       " 'uris': None,\n",
       " 'included': ['metadatas', 'documents', 'distances'],\n",
       " 'data': None,\n",
       " 'metadatas': [[None, None]],\n",
       " 'distances': [[0.36780744791030884, 0.435652494430542]]}"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 计算你输入的query_texts和所有collection里面的documents的距离\n",
    "collection.query(\n",
    "    query_texts=[\"apple\"]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7625697f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'ids': [['id1']], 'embeddings': None, 'documents': [['This is a document about pineapple']], 'uris': None, 'included': ['metadatas', 'documents', 'distances'], 'data': None, 'metadatas': [[None]], 'distances': [[1.040400743484497]]}\n"
     ]
    }
   ],
   "source": [
    "# 查询\n",
    "results = collection.query(\n",
    "    query_texts=[\"This is a query document about hawaii\"],\n",
    "    n_results=2\n",
    ")\n",
    "\n",
    "print(results)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2cfcefc6",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 删除\n",
    "collection.delete(ids=[\"id2\"])  # 删除document\n",
    "# chroma_client.delete_collection(name=\"my_collection\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "1ab831ee",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 更新\n",
    "collection.upsert(\n",
    "    documents=[\n",
    "        \"This is a document about pineapple\",\n",
    "        \"This is a document about oranges\"\n",
    "    ],\n",
    "    ids=[\"id1\", \"id2\"]\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "d7de4029",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 统计集合中documents数量\n",
    "collection.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2895e714",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "study_chroma",
   "language": "python",
   "name": "study_chroma"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
